<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>申请创建品酒俱乐部</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav fs_xl">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title fs_xl">申请创建品酒俱乐部</h1>
		</header>
		<div class="mui-content fs_xl">
			<form class="mui-input-group" method="post" style="padding-bottom: 1em;" onsubmit="return check();">
				<div class="mui-input-row" style="margin-top: 1em;">
					<label class="fs_m">创建者：</label>
					<input type="text" name="user_name" id="user_name"  class="mui-input-clear fs_m" placeholder="创建者姓名">
				</div>
				<div class="mui-input-row">
					<label class="fs_m">创建者ID号：</label>
					<input type="text" class="mui-input-clear fs_m" value="{$user_id|sprintf='%09d',###}" disabled="disabled" placeholder="创建者平台ID号">
				</div>
				<div class="mui-input-row">
					<label class="fs_m">手机号码：</label>
					<input type="tel" name="user_mobile" id="user_mobile" class="mui-input-clear fs_m" placeholder="创建者手机号码" >
				</div>
				<div class="mui-input-row">
					<label class="fs_m">邮箱：</label>
					<input type="text" name="user_email" id="user_email" class="mui-input-clear fs_m" placeholder="创建者邮箱地址" >
				</div>
				<div class="mui-input-row">
					<label class="fs_m">微信号：</label>
					<input type="tel" name="user_weixin" id="user_weixin" class="mui-input-clear fs_m" placeholder="创建者微信号" >
				</div>
				<div class="mui-input-row">
					<label class="fs_m">申请区域：</label>
					<input type="text"  class="mui-input-clear fs_m"  value="{$addressname[0]}{$addressname[1]}{$addressname[2]}" disabled="disabled" >
					<input type="hidden" class="mui-input-clear fs_m" name="province" value="{$province}" readonly="readonly" >
					<input type="hidden" class="mui-input-clear fs_m" name="city" value="{$city}" readonly="readonly" >
					<input type="hidden" class="mui-input-clear fs_m" name="district" value="{$district}" readonly="readonly" >
				</div>
				<div class="mui-input-row">
					<label class="fs_m">俱乐部名称：</label>
					<input type="text" name="club_name" id="club_name" value="{$addressname1}{$user_id}品酒俱乐部" readonly="readonly" class="fs_m" placeholder="例：青羊区+ID号+品酒俱乐部">
				</div>
				<div class="mui-input-row last2" style="height:6em;margin-top: 0.6em;">
					<label class="fs_m" style="line-height: 6em;" class="fs_m">本地市场概况：</label>
					<textarea class="fs_m" name="desc" style="border: 1px solid #ccc;width:65%;height: 6em;margin-right: 0.7em;color: #999;" id="textarea" rows="5" placeholder="例：1、宴席用酒居多，2、主流品牌是xxx，3、香型，4、价格区间，5、俱乐部介绍"></textarea>
				</div>
				<div class="mui-button-row">
					<button type="submit" class="mui-btn mui-btn-primary" >确认创建</button>&nbsp;&nbsp;
<!-- 					<button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消创建</button> -->
				</div>
			</form>
		</div>
		<script>
			function checkUserName(){
    			var name=$("#user_name").val();
//  			var nameRegex=/^[^@#]{3,16}$/;
    			if(name==""){
    				alert("创建者姓名不能为空！");
    				return false;
    			} 			
			}
			function checkPhone(){
				var phone = $('#user_mobile').val();
				var regl=/^1(3|4|5|7|8)\d{9}$/;
				if(phone==""){
					alert("手机号码不能为空！");
					return false;
				}else{
					if(!(regl.test(phone))){ 
        				alert("手机号码有误，请输入正确的手机号码！");  
        				return false; 
    				} 
				}
			}
			function checkEmail(){
				var email=$("#user_email").val();
        		if(email==""){
            		alert("邮箱不能为空");
            		return false;
        		}else{
           	 		var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
         			if(!myreg.test(email)){
             			alert("邮箱格式不对,请输入正确的邮箱！");
             			return false;
             		}
           		}         
    		}
			function checkText(va){
				if(va==""){
					alert("不能为空，请仔细填写！！");
					return false;
				}
			}
			function check(){
				var res = checkUserName();
				if(res==false){
					return false;
				}
				res = checkPhone();
				if(res==false){
					return false;
				}
				res = checkEmail();
				if(res==false){
					return false;
				}
				var weixin = $("input[name='user_weixin']").val();
				if(weixin == ''){
					alert('微信号不能为空')
					return false;
				}
			
			}
		</script>
	</body>

</html>